//
//  Activitylist.m
//  UI-豆瓣项目APP
//
//  Created by dllo on 15/9/8.
//  Copyright (c) 2015年 孙鹏. All rights reserved.
//

#import "Activitylist.h"

@implementation Activitylist


#pragma mark -- 归档第2步：实现协议中编码方法
// 对model进行编码
-(void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.title forKey:@"title"];
    [aCoder encodeObject:self.begin_time forKey:@"begin_time"];
    [aCoder encodeObject:self.address forKey:@"address"];
    [aCoder encodeObject:self.category_name forKey:@"category_name"];
    [aCoder encodeObject:self.participant_count forKey:@"participant_count"];
    [aCoder encodeObject:self.wisher_count forKey:@"wisher_count"];
    [aCoder encodeObject:self.content forKey:@"content"];
    [aCoder encodeObject:self.image forKey:@"Image"];
    [aCoder encodeObject:self.headImage forKey:@"headImage"];
}

#pragma mark -- 归档第3步：实现协议中解码方法
// 对model进行解码
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [self init];
    if (self) {
        
        self.title = [aDecoder decodeObjectForKey:@"title"];
        self.begin_time = [aDecoder decodeObjectForKey:@"begin_time"];
        self.address = [aDecoder decodeObjectForKey:@"address"];
        self.category_name = [aDecoder decodeObjectForKey:@"category_name"];
        self.participant_count = [aDecoder decodeObjectForKey:@"participant_count"];
        self.wisher_count = [aDecoder decodeObjectForKey:@"wisher_count"];
        self.content = [aDecoder decodeObjectForKey:@"content"];
        self.image = [aDecoder decodeObjectForKey:@"Image"];
        self.headImage = [aDecoder decodeObjectForKey:@"headImage"];
    }
    return self;
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
    if ([key isEqualToString:@"owner"]) {
        
         self.name = [value objectForKey:@"name"];
        
    }
    

}

@end
